﻿using System;
using System.Windows;

namespace MDCAdminTool.Controls.Cache_Cluster
{
	/// <summary>
	/// Interaction logic for RenameWindow.xaml
	/// </summary>
	public partial class RenameWindow : Window
	{
		public RenameWindow(String clusterName)
		{
			DataContext = this;
			ClusterName = clusterName;
			InitializeComponent();
		}

		public String ClusterName { get; set; }

		public Boolean NameChanged { get; set; }

		private void ChangeName(object sender, RoutedEventArgs e)
		{
			ClusterName = txtName.Text;
			NameChanged = true;
			Hide();
		}

		private void TxtNameGotKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e)
		{
			txtName.SelectAll();
		}

		private void TxtNameGotMouseCapture(object sender, System.Windows.Input.MouseEventArgs e)
		{
			txtName.SelectAll();
		}
	}
}
